$def with (ip, se)
$code:
    urlencode = __import__('webui').urlencode
    match = __import__('re').match
    def gets(s):
        t=None
        if s in se:t=se[s]
        if s in ip:t=ip[s]
        return t
    def getfonturl(s):
        if match(r'^https?:/{2}\w.+$', s):
            return s
        else:
            return '/font?' + urlencode({'l':s})
<html>

<head>
    <title class="trans" trans="webui.index TITLE">bili WEB用户界面</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="viewport"
        content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <script src="js/jquery.js"></script>
    <script src="js/prototype.js"></script>
    <script src="js/translatie.js"></script>
    <script src="js/index.js"></script>
    <script src="js/footer.js"></script>
    <link rel="stylesheet" type="text/css" href="css/topmenu.css">
    <link rel="stylesheet" type="text/css" href="css/index.css">
    <link rel="stylesheet" type="text/css" href="css/footer.css">
$ fontname=gets('uifont')
$if fontname is not None:
    <style>body, #main input {font-family: "$fontname";}</style>
    $if 'uifontloc' in se:
        <style>@font-face{font-family: "$fontname";src: local("$fontname"),url("$:getfonturl(se['uifontloc'])")}</style>
</head>

<body>
    <div class="topmenu first">
        <div class="select"><a href="/" class="trans" trans="webui.index MAINPAGE">主页</a></div>
        <div><a href="/downloadlist" class="trans" trans="webui.index DOWNLIST">下载任务列表</a></div>
        <div><a href="/settings" class="trans" trans="webui.index SETTING">设置</a></div>
    </div>
    <div id="main">
        <label class="trans" trans="bili.start INPUT1">请输入av/ss/ep/md/bv号（BV号请以BV开头）或者链接（支持用户页的收藏夹、频道、投稿、小视频链接，支持直播、直播回放和已购课程视频链接）：</label>
        <br/>
        <input class="trans tvalue" id="inp" trans="webui.index ENTTOS" n="请按Enter以确认。">
    </div>
    <div class="footer">
        <div><a href="/about" class="trans" trans="webui.index ABOUT">关于</a></div>
        <div><a href="https://github.com/lifegpc/bili" class="trans" trans="webui.index SOURCE">源代码</a></div>
        <div><a href="https://www.gnu.org/licenses/gpl-3.0-standalone.html" class="trans" trans="webui.index LICENSE">许可证</a></div>
    </div>
</body>

</html>
